package com.eclipse.organigram.views.commands;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PlatformUI;

import com.eclipse.organigram.views.OrganigramView;

public class ExpandOrganigram extends AbstractHandler {

	@Override
	public Object execute(ExecutionEvent event) throws ExecutionException {
        IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
        if (part instanceof OrganigramView) {
        	((OrganigramView) part).expand();
        }
		return null;
	}

}
